SetPalette
Loads a new
palette and replaces the image of the imaG
with an image that has been dithered to the new palette (the closest colors in the image's palette
are used) .
Syntax: | imaG.SetPalette (mode , palette()) |
mode (constant) | See caPalModeConstants |
palette() (long array) | OPTIONAL - The array to define the new palette. Each element of the array will contain one palette entry in RGB format. |
Returns: | (empty) |
The palette array must be defined with dimensions, with the statment : Dim|Private|Public palette(x To y) As Long . The array dimensions will be:
(0 To 1) for a Depth of 1 bit per pixel
(0 To 15) for a Depth of 4 bit per pixel
(0 To 255) for a Depth of 8 bit per pixel
MODE
caPalModeCustom = 0 | Sets a custom palette - The palette array must be specified | |
caPalModeCompact = 1 | Compacts the current palette using only the colors in the image | |
caPalModeWindows = 2 | Sets the standard windows palette | |
caPalModeWeb = 3 | Sets the WebSafe palette | |
caPalModeScaleRed = 4 | Sets a red scale palette | |
caPalModeScaleGreen = 5 | Sets a green scale palette | |
caPalModeScaleBlue = 6 | Sets a blue scale palette | |
caPalModeScaleAqua = 7 | Sets a aqua scale palette | |
caPalModeScaleMagenta = 8 | Sets a magenta scale palette | |
caPalModeScaleYellow = 9 | Sets a yelloow scale palette | |
The image will be dithered to the new palette. |
If the image is a true color image (24 bit per pixel depth), an ERROR will be thrown.
If MODE PROPERTY is NOT caModeDraw then an ERROR will be thrown.
See also Color & Palettes , GetPalColor , SetPalColor , GetPalette